<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <!DOCTYPE html>
    <html lang="en">

    <head>
        <title>Hello World</title>
    </head>

    <body>
        <div id="root"></div>
        <script src="./sdk/react.development.js"></script>
        <script src="./sdk/react-dom.development.js"></script>
        <script src="./sdk/babel.min.js"></script>
        <script type="text/babel">
            // 三元运算符    条件 ? 结果1 : 结果2
            // 逻辑运算符   &&  ||  !     XXXX&&XXX
            class Loading extends React.Component {
                isLoading = false // 专门用来控制是否是加载态
                getLoading() {
                    if (this.isLoading) {
                        return <div>加载中...</div>
                    } else {
                        return <p>加载完毕</p>
                    }
                }
                render() {
                    return <div>
                        {this.isLoading ? <div>加载中...</div> : <p>加载完毕</p>}
                        <br />
                        {this.isLoading && <div>加载中...</div>}
                        <br />
                        {this.getLoading()}
                    </div >
                }
            }
            ReactDOM.render(
                <Loading />,
                document.getElementById('root')
            );
        </script>
    </body>

    </html>
</body>

</html>